package cn.ffcs.uec.outStaffAdjustApply.action;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.Components;

import cn.ffcs.raptornuke.plugin.common.zk.ctrl.BasePortletComposer;
import cn.ffcs.raptornuke.portal.theme.ThemeDisplay;
import cn.ffcs.uec.outStaffAdjustApply.action.bean.OutStaffAdjustApplyMainBean;
import cn.ffcs.uom.common.util.IPortletInfoProvider;

@Controller
@Scope("prototype")
public class OutStaffAdjustApplyMainComposer extends BasePortletComposer
		implements IPortletInfoProvider {
	private static final long serialVersionUID = 7665135921079018195L;

	private OutStaffAdjustApplyMainBean bean = new OutStaffAdjustApplyMainBean();

	@Override
	public String getPortletId() {
		return super.getPortletId();
	}

	@Override
	public ThemeDisplay getThemeDisplay() {
		return super.getThemeDisplay();
	}

	@Override
	public void doAfterCompose(Component comp) throws Exception {
		super.doAfterCompose(comp);
		Components.wireVariables(comp, bean);
		bean.getOutStaffAdjustApplyListboxExt().setPortletInfoProvider(this);

//		this.bean.getOutStaffAdjustApplyListboxExt().addForward(
//				"onSelectOrgDeptByPkOrg",
//				this.bean.getOutStaffAdjustApplyListboxExt().getBean()
//						.getUecOrgDeptsBandboxExt().getBean()
//						.getUecOrgDeptsListboxExt(),
//				"onSelectOrgDeptByPkOrgResponse");

		this.bean.getOutStaffAdjustApplyListboxExt().addForward(
				"onUecDeptSelect",
				this.bean.getOutStaffAdjustApplyListboxExt().getBean()
						.getUecPostBandboxExt().getBean()
						.getUecPostListboxExt(), "onUecDeptSelectResponse");
	}
}
